#include <bits/stdc++.h>

typedef long long LL;

#define int long long

using namespace std;

const int MAXL = 1 << 22;
char i_str[MAXL], o_str[MAXL], *i_s, *i_t;
int o_t;
#define Flush fwrite(o_str,1,o_t,stdout), o_t = 0
#define space pc(' ')
#define enter pc('\n')

inline char gc() {
    if (i_s == i_t) {
        i_s = i_str;
        i_t = i_s + fread(i_str, 1, MAXL, stdin);
        return i_s == i_t ? EOF : *i_s++;
    } else
        return *i_s++;
}

inline int read() {
    int x = 0, f = 0;
    char ch = gc();
    for (; ch < '0' || ch > '9'; ch = gc())
        if (ch == '-')
            f = 1;
    for (; ch >= '0' && ch <= '9'; ch = gc())
        x = x * 10 + (ch ^ 48);
    return f ? -x : x;
}

inline void pc(char x) {
    o_str[o_t++] = x;
    if (o_t == MAXL)
        Flush;
}

void write(int x) {
    if (x < 0)
        pc('-'), x = -x;
    if (x > 9)
        write(x / 10);
    pc(x % 10 ^ 48);
}

const int N = 1e6 + 6, Mod = 998244353;

int n, m, k, a, b, c, d, f[N][4];

signed main() {
	n = read(), m = read(), k = read();
	a = read(), b = read(), c = read(), d = read();
	if (a != c && b != d) 
		f[0][0] = 1;
	if (a == c && b != d)
		f[0][1] = 1;	
	if (a != c && b == d)
		f[0][2] = 1;
	if (a == c && b == d)
		f[0][3] = 1;
	for (register int i = 1; i <= k; ++i) {
		f[i][0] = ((f[i - 1][1] * (n - 1) % Mod + f[i - 1][2] * (m - 1)) % Mod + f[i - 1][0] * (n + m - 4) % Mod) % Mod;
		f[i][1] = ((f[i - 1][0] + f[i - 1][3] * (m - 1) % Mod) % Mod + f[i - 1][1] * (m - 2) % Mod) % Mod;
		f[i][2] = ((f[i - 1][0] + f[i - 1][3] * (n - 1) % Mod) % Mod + f[i - 1][2] * (n - 2) % Mod) % Mod;
		f[i][3] = (f[i - 1][1] + f[i - 1][2]) % Mod;
	}
	write(f[k][3]), enter ;
	Flush ;
	return 0;
}